package com.ghca.myinfo3.common.eneity;

import com.ghca.myinfo3.project.entity.Project;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * Created by Administrator on 2016/12/21.
 */
public class BJUIPage<T> {

    private long totalRow;

    private long pageCurrent;

    private List<T> list;

    public BJUIPage() {

    }


    public BJUIPage(Page<T> page) {
        setPage(page);
    }

    public BJUIPage(long totalRow, long pageCurrent, List<T> list) {
        this.totalRow = totalRow;
        this.pageCurrent = pageCurrent;
        this.list = list;
    }

    public long getPageCurrent() {
        return pageCurrent;
    }

    public long getTotalRow() {
        return totalRow;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public void setPage(Page<T> page) {
        this.totalRow=page.getTotalElements();
        this.pageCurrent = page.getNumber();
        this.list = page.getContent();
    }
}
